<%@ page import="entity.Emp" %>
<%@ page import="util.StringUtil" %><%--
  Created by IntelliJ IDEA.
  User: User
  Date: 2024/5/13
  Time: 14:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
    <head>
        <title>修改员工信息</title>
    </head>
    <body>
        <h1>修改员工信息</h1>
        <a href="<%=request.getContextPath()%>/findAll.ems">返回员工列表</a>
        <hr>
        <%
            Emp emp= (Emp) request.getAttribute("emp");
        %>
        <form action="<%=request.getContextPath()%>/modify.ems" method="post">
            编号:<input type="text" name="id" value="<%=emp.getId()%>" readonly><br>
            姓名:<input type="text" name="name" value="<%=emp.getName()%>"><br>
            工资:<input type="text" name="salary" value="<%=emp.getSalary()%>"><br>
            性别:
            <input type="radio" name="gender" <%=emp.getGender().equals("man")?"checked":""%>>男
            <input type="radio" name="gender" <%=emp.getGender().equals("woman")?"checked":""%>>女
            <br>
            学历:
            <select name="edu" >
                <option value="-1">请选择</option>
                <option value="1" <%=emp.getEdu().equals("1")?"selected":""%> >高中</option>
                <option value="2" <%=emp.getEdu().equals("2")?"selected":""%> >大专</option>
                <option value="3" <%=emp.getEdu().equals("3")?"selected":""%> >本科</option>
                <option value="4" <%=emp.getEdu().equals("4")?"selected":""%> >研究生</option>
            </select>
            <br>
            兴趣:
            <input type="checkbox" name="hobbies" value="eat" <%=StringUtil.checkHobby(emp.getHob(),"eat")%>>吃饭
            <input type="checkbox" name="hobbies" value="sleep" <%=StringUtil.checkHobby(emp.getHob(),"sleep")%> >睡觉
            <input type="checkbox" name="hobbies" value="beat" <%=StringUtil.checkHobby(emp.getHob(),"beat")%>>打豆豆
            <input type="submit"  value="修改">

        </form>
    </body>
</html>
